package com.gaga.web.config;

import com.gaga.web.filter.AuthorizationFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfig {

    /*@Bean*/
    public FilterRegistrationBean filterRegist() {

    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(new AuthorizationFilter());
    registration.setName("AuthorizationFilter");
    registration.addUrlPatterns("/main");//作为演示，仅仅只限制/main 访问
    registration.setOrder(5);
        return registration;
    }
}

